﻿using Ewell.BizComponent.Proxy;
using Ewell.BizComponent.Proxy.Model;
using Newtonsoft.Json;
using System;
using System.Windows.Forms;

namespace WindowsFormsApp3
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            //textBox1.Text = "{\"deptCode\":\"30010301\",\"staffCode\":\"9999-100\",\"userName\":null,\"userNameCn\":\"超级管理员\",\"hcCode\":null,\"hcName\":null,\"account\":\"9999-100\",\"userId\":null,\"id\":null,\"loginToken\":\"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpbk5hbWUiOiI5OTk5LTEwMCIsImV4cCI6MTY5MDcwNTEzMCwidXNlcklkIjoiOTk5OS0xMDAifQ.U8i_pV4aRvAfqqbXo5ZZnJm5tQKQmk8xZBtJ_26Lxbw\",\"no\":\"9999-100\",\"deptName\":\"门诊收费室\",\"isPasswordCompliance\":true,\"passwordRules\":null,\"passwordRulesRemark\":null,\"zone\":\"01\",\"zoneName\":\"秀英院本部\",\"zoneHcCode\":null,\"zoneHcName\":null,\"ipAddress\":\"\",\"computerName\":\"\",\"macAddress\":\"\",\"bizSourceCode\":\"4\"}";
            textBox1.Text = string.Empty;
            textBox2.Text = "{\"tradeCode\":\"101\",\"employeeNo\":\"2615\",\"employeeName\":\"黄宇凡\",\"deptNo\":\"30010301\",\"deptName\":\"门诊收费室\",\"interfaceId\":\"1335424906435072000\",\"alreadySelectDataList\":[],\"zone\":\"33331\",\"cardInfo\":{}}";
            textBox3.Text= "{ \"menuId\": \"1444450153871544320\", \"bizSourceCode\": \"4\", \"patientId\": \"202183\", \"patientName\": \"宋学栋\", \"docFid\": null, \"docCode\": \"2615\", \"docName\": \"黄宇凡\", \"deptFid\": null, \"deptCode\": 1060000, \"deptName\": \"耳鼻科\"}";
        }

        private void button1_Click(object sender, EventArgs e)
        {
            textBox4.Text = string.Empty;
            BizRequest bizRequest = new BizRequest();
            bizRequest.authentication=textBox1.Text;
            bizRequest.header=textBox2.Text;
            bizRequest.domain=textBox3.Text;
            BizProxy bizProxy = new BizProxy();
            var result = bizProxy.bizInvoke(bizRequest);
            textBox4.Text = JsonConvert.SerializeObject(result);
        }
    }
}
